<?php

/**
 * InsAtelier filter form base class.
 *
 * @package    tfe
 * @subpackage filter
 * @author     3emeIG
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedInheritanceTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseInsAtelierFormFilter extends InscriptionFormFilter
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['saison'] = new sfWidgetFormChoice(array('choices' => array('' => '', '2007-2008' => '2007-2008', '2008-2009' => '2008-2009', '2009-2010' => '2009-2010', '2010-2011' => '2010-2011', '2012-2013' => '2012-2013', '2014-2015' => '2014-2015', '2015-2016' => '2015-2016', '2016-2017' => '2016-2017', '2018-2019' => '2018-2019', '2019-2020' => '2019-2020')));
    $this->validatorSchema['saison'] = new sfValidatorChoice(array('required' => false, 'choices' => array('2007-2008' => '2007-2008', '2008-2009' => '2008-2009', '2009-2010' => '2009-2010', '2010-2011' => '2010-2011', '2012-2013' => '2012-2013', '2014-2015' => '2014-2015', '2015-2016' => '2015-2016', '2016-2017' => '2016-2017', '2018-2019' => '2018-2019', '2019-2020' => '2019-2020')));

    $this->widgetSchema   ['id_atelier'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Atelier'), 'add_empty' => true));
    $this->validatorSchema['id_atelier'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Atelier'), 'column' => 'id'));

    $this->widgetSchema   ['paiement_en_deux_fois'] = new sfWidgetFormChoice(array('choices' => array('' => '', 'non' => 'non', 'oui' => 'oui')));
    $this->validatorSchema['paiement_en_deux_fois'] = new sfValidatorChoice(array('required' => false, 'choices' => array('non' => 'non', 'oui' => 'oui')));

    $this->widgetSchema   ['mode_de_paiement_second_semestre'] = new sfWidgetFormChoice(array('choices' => array('' => '', 'liquide' => 'liquide', 'virement' => 'virement', 'carte' => 'carte', 'chèque' => 'chèque')));
    $this->validatorSchema['mode_de_paiement_second_semestre'] = new sfValidatorChoice(array('required' => false, 'choices' => array('' => '', 'liquide' => 'liquide', 'virement' => 'virement', 'carte' => 'carte', 'chèque' => 'chèque')));

    $this->widgetSchema   ['date_de_paiement_second_semestre'] = new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate()));
    $this->validatorSchema['date_de_paiement_second_semestre'] = new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false))));

    $this->widgetSchema   ['code_de_paiement_second_semestre'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['code_de_paiement_second_semestre'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema->setNameFormat('ins_atelier_filters[%s]');
  }

  public function getModelName()
  {
    return 'InsAtelier';
  }

  public function getFields()
  {
    return array_merge(parent::getFields(), array(
      'saison' => 'Enum',
      'id_atelier' => 'ForeignKey',
      'paiement_en_deux_fois' => 'Enum',
      'mode_de_paiement_second_semestre' => 'Enum',
      'date_de_paiement_second_semestre' => 'Date',
      'code_de_paiement_second_semestre' => 'Text',
    ));
  }
}
